Skip to content

Comments

109 my plot diff#110

Merged
audreyyeoCH merged 75 commits intomainfrom
109_myPlotDiff
Feb 8, 2025
Merged

109 my plot diff#110
audreyyeoCH merged 75 commits intomainfrom
109_myPlotDiff

Conversation

@audreyyeoCH
Copy link
Collaborator

closes #109

Copy link
Collaborator

@danielinteractive danielinteractive left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @audreyyeoCH , thanks for the updates, please see comments

@audreyyeoCH
Copy link
Collaborator Author

Hi @danielinteractive , we labeled X as control arm in dbetadiff(), I think we can change X as control for this PR, let me know what you think

#' two parameters of `X`'s Beta distribution (Control)

@danielinteractive
Copy link
Collaborator

Hi @danielinteractive , we labeled X as control arm in dbetadiff(), I think we can change X as control for this PR, let me know what you think

Thanks @audreyyeoCH , yeah good point, it needs to be consistent for sure, because here the function calls dbetadiff()

@audreyyeoCH
Copy link
Collaborator Author

Hi @danielinteractive , we labeled X as control arm in dbetadiff(), I think we can change X as control for this PR, let me know what you think

Thanks @audreyyeoCH , yeah good point, it needs to be consistent for sure, because here the function calls dbetadiff()

cool I'll change it

@audreyyeoCH
Copy link
Collaborator Author

audreyyeoCH commented Feb 2, 2025

Hi @danielinteractive have you seen this issue before ? It works fine until the R cmdchecks.
Screenshot 2025-02-02 at 19 16 10

Tried to address error moving the mapping in geom_line() which comes up with another error :

Screenshot 2025-02-02 at 19 42 11

An option would be :

 if (shade) {
    pbetadiff_plot <- ggplot2::ggplot(data = data, mapping = aes(x = grid, y = density)) +
      ggplot2::geom_line(colour = "#888888") 
pbetadiff_plot <- pbeta_plot + # here I changed something
       ggplot2::geom_area(
        data = data[data$grid < stop_cut, ], fill = "#FF0046",
        mapping = aes(x = ifelse(grid < 0.2 & grid < 0.5, grid, 0))
      ) +
      ggplot2::geom_area(
        data = data[data$grid > go_cut, ], fill = "#009E73",
        mapping = aes(x = ifelse(grid > 0.3, grid, 0))
      ) +
      xlab("Difference between treatment") +
      ggplot2::ylab(quote(f(x))) +
      ggplot2::ggtitle(plot_title)
  }



@danielinteractive
Copy link
Collaborator

@audreyyeoCH I think just prefixing, i.e. ggplot2::aes() should help. For the second issue, the y aesthetic was missing it seems.

Copy link
Collaborator

@danielinteractive danielinteractive left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are still problems in the R CMD check output, please can you fix those?

@audreyyeoCH audreyyeoCH merged commit 22bbad6 into main Feb 8, 2025
23 checks passed
@audreyyeoCH audreyyeoCH deleted the 109_myPlotDiff branch February 8, 2025 14:30
@audreyyeoCH
Copy link
Collaborator Author

🥳

@audreyyeoCH audreyyeoCH mentioned this pull request Apr 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

109_myPlotDiff

2 participants